<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: pink;
            text-align: center;
            line-height: 100px;
            color: #fff;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div>
        搜索
    </div>
    <script>
        let timer
        const enter = document.querySelector('div')
        enter.addEventListener('click',function(){
            // 取消计时器
            clearTimeout(timer)
            // 计时器
            timer = setTimeout(()=>{
                console.log('搜索');
            },600)
        })
    </script>
</body>
</html>